import Vue from 'vue'
import App from './App.vue'
import './registerServiceWorker'
import router from './router'
import store from './store'
import '@/plugins/iview'
import '@/plugins/v-charts'
import '@/components'
import '@/libs/rem'
import '@/assets/styles/index.scss'
import axios from 'axios'
Vue.config.productionTip = false
Vue.prototype.$axios = axios
new Vue({
  router,
  store,
  render: (h) => h(App)
}).$mount('#app')
router.beforeEach((to,from,next)=>{
  if(to.path==='/login'){
    sessionStorage.clear()
    store.commit('setBeginState', 1)
    store.commit('online_id', [])
    store.commit('setCurrentfixed', 1)
    store.commit('setSchoolId', 0)
    store.commit('setPermission_name', '')
    store.commit('setCurrentArea', 1)
    store.commit('setCurrentProvince', 0)
    store.commit('setCurrentCity', 0)
    store.commit('setCurrentCounty', '')
    store.commit('setOnline_id', [])
    next()
  }else{
    next();
  }
})
